﻿using Autofac;
using Dyao.Book.Application;
using Dyao.Book.Repository;
using Dyao.Book.Repository.Shared;
using Foundation.AutoMapper;
using Foundation.Caching;
using Foundation.Core;
using Foundation.DistributeLock.RedLock;
using Foundation.EntityFrameworkCore;
using Foundation.Spider;
using Foundation.Uow;

namespace Dyao.Book.Web.Extensions
{
    public static class AutofacConfigurationExtensions
    {
        public static void AddAutofacServices(this ContainerBuilder containerBuilder)
        {
            containerBuilder.RegisterModule(new RepositoryModule());
            containerBuilder.RegisterModule(new RepositorySharedModule());
            containerBuilder.RegisterModule(new EntityFrameworkCoreModule());
            containerBuilder.RegisterModule(new ObjectMappingModule());
            containerBuilder.RegisterModule(new UnitOfWorkModule());
            containerBuilder.RegisterModule(new ApplicationModule());
            containerBuilder.RegisterModule(new CoreModule());
            containerBuilder.RegisterModule(new SpiderModule());
            containerBuilder.RegisterModule(new RedLockModule());
            containerBuilder.RegisterModule(new CachingModule());
        }
    }
}
